package com.rem.designPattern.prototype原型;

/**
 * 普通拷贝对象 复制另外一个对象的属性到新的对象中去
 *
 * @author Rem
 * @date 2022-11-15
 */
public class Client {

    public static void main(String[] args) {
        Sheep sheep = new Sheep("tom", 1);
        Sheep sheep2 = new Sheep(sheep.getName(), sheep.getAge());
        Sheep sheep3 = new Sheep(sheep.getName(), sheep.getAge());
        System.out.println(sheep + " hash " + sheep.hashCode());
        System.out.println(sheep2 + " hash " + sheep2.hashCode());
        System.out.println(sheep3 + " hash " + sheep3.hashCode());
    }
}
